#include<iostream>
#include "Matrix.h"

int main(){
  //input matrix1
  //cout<<"please input rows and columns of matrices"<<endl;
  Matrix matrix1;
  int row1 = matrix1.setrow();
  int col1 = matrix1.setcol();
  matrix1.is_square();
  //is square or not
  /*if(  matrix1.is_square() )
    cout<< "This is a square matrix" <<endl;
  else
    cout<< "This is not a square matrix" <<endl;
    //cout<<"please input data"<<endl;*/
  for(int i = 0; i < row1; i++)
    for(int j = 0; j < col1; j++)
      cin >> matrix1(i,j);

  //input matrix2
  //cout<<"please input the row and column of another matrix"<<endl;
  Matrix matrix2;
  int row2 = matrix2.setrow();
  int col2 = matrix2.setcol();
  matrix2.is_square();
  //is square or not
  /*if(  matrix2.is_square() )
    cout<< "This is a square matrix" <<endl;
  else
    cout<< "This is not a square matrix" <<endl;
    cout<<"please input the data"<<endl;*/
  for(int i = 0; i < row2; i++)
    for(int j = 0; j < col2; j++)
      cin >> matrix2(i,j);
  
  //compute the result
  //cout<<"The result is "<<endl;
  Matrix matrix3;
  matrix3 = (matrix1 * matrix2);
  for(int i = 0; i < row1; i++){
    for(int j = 0; j < col2; j++)
      cout<< matrix3(i,j)<<" ";
    cout << "" << endl;
  }
  
  //cout << "Please input vectors" <<endl;
  //test the vector
  vector v1;
  int colv = v1.setrowv();
  v1.is_square();
  //cout << "The cols or rows of v1 is " << colv <<endl;
  //cout <<"please input data:"<<endl;
  for(int i = 0; i < colv; i++)
    cin >> v1(0,i);
  
  //cout << "please inout another vector" << endl;
  vector v2;
  int rowv = v2.setcolv();
  v2.is_square();
  //cout << "The cols or rows of v2 is " << rowv << endl;
  //cout <<"please input data: "<<endl;
  for(int i = 0; i < rowv; i++)
    cin >> v2(i,0);

  double result = 0;
  result = v1 * v2;
  cout << result << endl;
  
  return 0;  
}
